home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / BUSINESS / SALE24.ARJ / PDIAL.PRG < prev    next >
Text File  |  1992-06-01  |  770b  |  41 lines

  1. Listing 1
  2. P_DIAL Telephone Dialing Function
  3.  
  4. FUNCTION p_dial
  5. PARAMETERS tel_no
  6.  
  7. ***  Telephone number must character data!
  8.  
  9. ***  note:  com port should be initialized before
  10. ***  going into application that uses function.
  11.  
  12. f_handle = 0
  13.  
  14. ON ERROR DO ph_errr
  15. f_handle = fopen('COM1','w')  &&  open-write only
  16. ON ERROR
  17.  
  18. IF f_handle = -1       &&  not a valid com port
  19.   ?? chr(7)
  20. ELSE                   &&  dial it!
  21.   junk = fputs(f_handle,'ATDT' + tel_no + ';')
  22.   junk = inkey(7)            &&  pause for pick-up
  23.   junk = fputs(f_handle,'ATZ')     &&  reset modem
  24.   junk = fclose(f_handle)          && close port
  25. ENDIF
  26.  
  27. RETURN(.t.)
  28.  
  29. ********
  30.  
  31. PROCEDURE ph_errr
  32.  
  33. ***  Error routine for bad com port.
  34.  
  35. f_handle = -1
  36. RETURN
  37.  
  38. *******
  39.  
  40.  
  41.